<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
            <meta charset="UTF-8">
    <link rel="stylesheet" href="${initParam.root}css/table.css" type="text/css">
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:choose>
<c:when test="${requestScope.dealList=='Empty'}">
<h2>상품이 없습니다.</h2>
</c:when>
<c:otherwise>
<table border="1" class="registerMemberTable"  style="margin: 0 auto ; width: auto" >
	<caption>제품 리스트</caption>
	<thead>
		<tr>
			<th class="dealTitle">딜명</th>
			<th class="dealPrice">가격</th>
			<th class="dealCount">개수</th>
			<th class="dealEndDate">마감일</th>
			<th class="dealImage">이미지</th>
		</tr>
		<c:forEach var="list" items="${requestScope.dealList}">
			<tr>
				<td><a href="${initParam.root }common/showDealContents.do?dealNumber=${list.dealNumber}">${list.dealTitle}</a></td>
				<td>${list.dealPrice }</td>
				<td>${list.dealCount }</td>
				<td>${list.dealEndDate }</td>
				            	           <td><c:choose>
            <c:when test="${list.dealCount==0 }">
				<a href="${initParam.root }common/showDealContents.do?dealNumber=${list.dealNumber}">
            	<img src="${initParam.root }upload/soldout.jpg" width="300px" height="300px"></a>
            </c:when>
            <c:otherwise>
                 <a href="${initParam.root }common/showDealContents.do?dealNumber=${list.dealNumber}">
            	<img src="${initParam.root }upload/${list.dealImage }" width="300px" height="300px"></a>
            </c:otherwise>
            </c:choose></td>
			</tr>
		</c:forEach>
</table>
</c:otherwise>
</c:choose>